﻿@using System.Globalization
@model SampleWebsite.Mvc3.Areas.MvcMembership.Models.UserAdministration.DetailsViewModel
<div class="display-label">
    User Name:</div>
<div class="display-field">
    @Model.User.UserName
</div>
<div class="display-label">
    Status:</div>
<div class="display-field">
    @Model.Status
</div>
<div class="display-label">
    Email Address:</div>
<div class="display-field">
    @Model.User.Email
    <div id="email" style="display: inline-block" @*class="ui-state-default ui-corner-all-email"*@>
        <a href="mailto:@Model.User.Email" class="ui-icon ui-icon-mail-closed">mail</a>
    </div>
</div>
@if (Model.User.LastActivityDate == Model.User.CreationDate)
{
    <div class="display-label">
        Last Active:</div>
    <div class="display-field">
        <em>Never</em>
    </div>
    <div class="display-label">
        Last Login:</div>
    <div class="display-field">
        <em>Never</em>
    </div>
}
else
{
    <div class="display-label">
        Last Active:</div>
    <div class="display-field">
        @Model.User.LastActivityDate.ToString("MMMM dd, yyyy h:mm:ss tt", CultureInfo.InvariantCulture)
    </div>
    <div class="display-label">
        Last Login:</div>
    <div class="display-field">
        @Model.User.LastLoginDate.ToString("MMMM dd, yyyy h:mm:ss tt", CultureInfo.InvariantCulture)
    </div>
}

<div class="display-label">
        Created:</div>
    <div class="display-field">
        @Model.User.CreationDate.ToString("MMMM dd, yyyy h:mm:ss tt", CultureInfo.InvariantCulture)
    </div>

@Html.ActionLink("Edit User Roles", "UsersRoles", "UserAdministration", new { id = Model.User.ProviderUserKey }, new {@class = "editLink" })

@using (Html.BeginForm("ChangeApproval", "UserAdministration", new { id = Model.User.ProviderUserKey },FormMethod.Post,new { @class = "ajaxable" }))
{
    <input type="submit" value='Enable Disable Account' />
}
@using (Html.BeginForm("DeleteUser", "UserAdministration", new { id = Model.User.ProviderUserKey }))
{

    <input type="submit" value="Delete Account" />
}